// 放面试题之类的
import request from '@/utils/request.js'

export const articleListAPI = ({ current, sorter }) => {
  return request.get('/h5/interview/query', {
    params: {
      current: current, // 获取第几页的数据
      pageSize: 10, // 每页10条数据
      sorter: sorter // weight_desc表示获取推荐数据 || null表示获取最新数据
    }
  })
}
// 获取单个面经详情
export const getArticleDetail = (id) => {
  return request.get('/h5/interview/show', { params: { id: id } })
}

// 获取点赞收藏
export const updateLikeAndCollect = (data) => {
  return request.post('/h5/interview/opt', data)
}

// 我的收藏
export const collectAndLikeListAPI = ({ page, optType }) => {
  return request.get('/h5/interview/opt/list', {
    params: {
      page,
      optType: optType
    }
  })
}

// 获取用户信息
export const getUserInfoAPI = () => {
  return request.get('/h5/user/currentUser')
}
